<template>
  <view class="queryBox">
    <!-- 查询操作区域 -->
    <t-space align="center" style="flex-wrap: wrap">
      <t-button theme="default" @click="onReset">
        <template #icon>
          <refresh-icon />
        </template>
        重置
      </t-button>
      <t-button theme="primary" @click="onSearch">
        <template #icon>
          <search-icon />
        </template>
        查询
      </t-button>
      <slot></slot>
    </t-space>
  </view>
</template>
<script setup lang="ts">
import { RefreshIcon, SearchIcon } from 'tdesign-icons-vue-next';

const emit = defineEmits(['search', 'reset', 'update:defaultCurrent']);
const onSearch = () => {
  emit('update:defaultCurrent', 1);
  emit('search');
};

const onReset = () => {
  emit('reset');
};
</script>
<style lang="less" scoped>
.queryBox {
  display: block;
  background-color: #fff;
  padding: 24px;
  margin-bottom: 24px;
}
</style>
